﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/Site.Master" AutoEventWireup="true"
	CodeBehind="EditEvent.aspx.cs" Inherits="Hematology.UserSite.admin.EditEvent" %>

<%@ Import Namespace="Hematology.Tools" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphRecent" runat="server">
	<hmt:PageTitle runat="server" ID="ptTitle" ButtonText='<%$ Resources:UserSite, resWhitespace %>'
		ButtonCssClass="plus" ShowButton="True" TitleButtonType="Hyperlink" NavigateUrl='<%# String.Format("/admin/EditEvent.aspx?et={0}&view=Add", CurrentEventType) %>' />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphHeadNews" runat="server">
	<asp:MultiView runat="server" ID="mvEvents">
		<asp:View runat="server" ID="vEventList">
			<asp:Repeater runat="server" ID="rptSiteEvent" OnItemCommand="rptSiteEvent_ItemCommand">
				<HeaderTemplate>
					<div class="userFullPageContainer">
						<div class="adminTableBlock">
							<div class="adminTableRow adminTableRowHeader">
								<div class="adminTableRow150">
									<asp:Label ID="lEventNameHdr" runat="server" Text='<%$ Resources:UserSite, resCommonTitle %>' />
								</div>
								<div class="adminTableRowDate">
									<asp:Label ID="lEventDateStartHdr" runat="server" Text='<%$ Resources:UserSite, resDateStart %>' />
								</div>
								<div class="adminTableRowDate">
									<asp:Label ID="lEventDateFinishHdr" runat="server" Text='<%$ Resources:UserSite, resDateFinish %>' />
								</div>
								<div class="adminTableRowDate">
									<asp:Label ID="lEventDateCreatedHdr" runat="server" Text='<%$ Resources:UserSite, resDateCreated %>' />
								</div>
								<div class="adminTableRowDate">
									<asp:Label ID="lEventDateModifiedHdr" runat="server" Text='<%$ Resources:UserSite, resDateModified %>' />
								</div>
							</div>
				</HeaderTemplate>
				<ItemTemplate>
					<div class="adminTableRow">
						<div class="adminTableRow150">
							<asp:HyperLink runat="server" ID="hlEventName" Text='<%# Eval("Title") %>' NavigateUrl='<%# String.Format("/admin/EditEvent.aspx?et={0}&view=Edit&id={1}", CurrentEventType, Eval("EventId")) %>' />
						</div>
						<div class="adminTableRowDate">
							<asp:Label ID="lEventDateStart" runat="server" Text='<%# PageHelper.SetDateCellContent(Eval("StartDate")) %>' />
						</div>
						<div class="adminTableRowDate">
							<asp:Label ID="lEventDateFinish" runat="server" Text='<%# PageHelper.SetDateCellContent(Eval("FinishDate")) %>' />
						</div>
						<div class="adminTableRowDate">
							<asp:Label ID="lEventDateCreatedHdr" runat="server" Text='<%# PageHelper.SetDateCellContent(Eval("CreateDate")) %>' />
						</div>
						<div class="adminTableRowDate">
							<asp:Label ID="lEventDateModifiedHdr" runat="server" Text='<%# PageHelper.SetDateCellContent(Eval("LastModifiedDate")) %>' />
						</div>
						<div class="adminTableRowIconBlock">
							<div class="adminTableRowIcon">
								<asp:Image runat="server" ID="imgEventAttach" ImageUrl="~/img/copy-1.png" Visible='<%# Convert.ToInt32(Eval("FileAttachements.Count")) > 0 %>'
									ToolTip='<%# PageHelper.GetAttachIconToolTip(Eval("FileAttachements.Count")) %>' />
							</div>
							<div class="adminTableRowIcon">
								<asp:HyperLink ID="hlEditEvent" runat="server" NavigateUrl='<%# String.Format("/admin/EditEvent.aspx?et={0}&view=Edit&id={1}", CurrentEventType, Eval("EventId")) %>'
									ToolTip='<%$ Resources:UserSite, resEdit %>' CssClass="adminTableRowEdit" />
							</div>
							<div class="adminTableRowIcon">
								<asp:LinkButton ID="btnDeleteEvent" runat="server" ToolTip="Удалить" CommandName="DeleteEvent"
									CommandArgument='<%# Eval("EventId") %>' OnClientClick="return confirm('Подтвердите удаление')"
									CssClass="adminTableRowDelete" />
							</div>
						</div>
					</div>
				</ItemTemplate>
				<FooterTemplate>
					</div> </div>
					<div style="clear: both;">
					</div>
				</FooterTemplate>
			</asp:Repeater>
		</asp:View>
		<asp:View runat="server" ID="vEventEdit">
			<div class="editorBlock">
				<div class="editorBlockEditControl">
					<div class="editorBlockTitle">
						<asp:Label runat="server" ID="lblSiteEventTitle" Text='<%$ Resources:UserSite, resCommonTitle %>' />
						<span class="asterisk">
							<asp:Label runat="server" ID="lblSiteEventTitleAsterisk" Text='<%$ Resources:UserSite, resAsterisk %>' />
						</span>
					</div>
					<div class="editorBlockControl">
						<asp:TextBox runat="server" ID="txtSiteEventTitle" MaxLength="150" />
						<asp:RequiredFieldValidator ID="vldEventContentTitleIsRequired" runat="server" ControlToValidate="txtSiteEventTitle"
							ErrorMessage='<%$ Resources:UserSite, resTitleIsRequired %>' Display="None" ValidationGroup="vgEditEvent"
							SetFocusOnError="true" />
					</div>
				</div>
				<div class="editorBlockEditControl">
					<div class="editorBlockTitle">
						<asp:Label runat="server" ID="lblSiteEventPlace" Text='<%$ Resources:UserSite, resEventPlace %>' />
					</div>
					<div class="editorBlockControl">
						<asp:TextBox runat="server" ID="txtSiteEventPlace" MaxLength="300" />
					</div>
				</div>
				<div class="editorDatePickerBlockControl">
					<div class="editorDatePickerTitle">
						<asp:Label ID="lEventDateStartHdr" runat="server" Text='<%$ Resources:UserSite, resDateStart %>' />
					</div>
					<div class="editorDatePicker">
						<hmt:CalendarPopup runat="server" ID="cpStartDate" Nullable="True" ShowClearDate="True"
							ClearDateText="Очистить" />
					</div>
					<div class="editorDatePickerTitle">
						<asp:Label ID="lEventDateFinishHdr" runat="server" Text='<%$ Resources:UserSite, resDateFinish %>' />
					</div>
					<div class="editorDatePicker">
						<hmt:CalendarPopup runat="server" ID="cpFinishDate" Nullable="True" ShowClearDate="True"
							ClearDateText="Очистить" />
					</div>
				</div>
				<div class="editorBlockWisiwig">
					<CKEditor:CKEditorControl runat="server" ID="ckedSiteEvent" BasePath="~/ckeditor" />
					<asp:RequiredFieldValidator ID="vldSiteContentIsRequired" runat="server" ControlToValidate="ckedSiteEvent"
						ErrorMessage='<%$ Resources:UserSite, resContentIsRequired %>' Display="None"
						ValidationGroup="vgEditEvent" SetFocusOnError="true" />
				</div>
				<div class="editorBlockButton">
					<asp:CheckBox runat="server" ID="checkIsVisible" Text='<%$ Resources:UserSite, resShowInList %>'
						Checked="true" />
				</div>
				<div class="editorBlockEditControl">
					<asp:Repeater runat="server" ID="rptContentAttach" OnItemCommand="rptContentAttach_ItemCommand">
						<HeaderTemplate>
							<div class="adminTableContainer">
								<div class="adminTableBlock">
									<div class="adminTableRow adminTableRowHeader">
										<div class="adminTableRow32">
											<asp:Label ID="lFileIconHdr" runat="server" Text='<%$ Resources:UserSite, resWhitespace %>' />
										</div>
										<div class="adminTableRow300">
											<asp:Label ID="lFileNameHdr" runat="server" Text='<%$ Resources:UserSite, resFileName %>' />
										</div>
										<div class="adminTableRow150 centered">
											<asp:Label ID="lFileFormatHdr" runat="server" Text='<%$ Resources:UserSite, resFileFormat %>' />
										</div>
										<div class="adminTableRow150 centered">
											<asp:Label ID="lFileSizeHdr" runat="server" Text='<%$ Resources:UserSite, resFileSize %>' />
										</div>
									</div>
						</HeaderTemplate>
						<ItemTemplate>
							<div class="adminTableRow">
								<div class="adminTableRow32">
									<asp:LinkButton runat="server" ID="btnOpenDocumentIcon" CssClass='<%# PageHelper.GetAttachIconClass(Eval("DocumentName")) %>'
										Text='<%$ Resources:UserSite, resWhitespace %>' />
								</div>
								<div class="adminTableRow300">
									<asp:LinkButton runat="server" ID="btnOpenDocument" Text='<%# Eval("DocumentName") %>'
										CommandName="OpenAttach" CommandArgument='<%# Eval("AttachId") %>' />
								</div>
								<div class="adminTableRow150 centered">
									<asp:Label ID="lDocumentType" runat="server" Text='<%# Eval("DocumentType") %>' />
								</div>
								<div class="adminTableRow150 centered">
									<asp:Label ID="lFileSize" runat="server" Text='<%# PageHelper.GetRoundedFileSize(Eval("DocumentSize")) %>' />
								</div>
								<div class="adminTableRowIconBlock">
									<div class="adminTableRowIcon">
										<asp:LinkButton ID="btnDeleteAttach" runat="server" ToolTip='<%$ Resources:UserSite, resDelete %>'
											CommandName="DeleteAttach" CommandArgument='<%# Eval("AttachId") %>' OnClientClick="return confirm('Подтвердите удаление')"
											CssClass="adminTableRowDelete" />
									</div>
								</div>
							</div>
						</ItemTemplate>
						<FooterTemplate>
							</div> </div>
							<div style="clear: both;">
							</div>
						</FooterTemplate>
					</asp:Repeater>
				</div>
				<div class="editorDatePickerBlockControl">
					<div class="editorDatePickerTitle">
						<asp:Label ID="lblAttachFile" runat="server" Text='<%$ Resources:UserSite, resAttachFile %>' />
					</div>
					<div class="editorDatePicker">
						<asp:FileUpload runat="server" ID="fuAttachFile" />
					</div>
					<div class="editorDatePicker">
						<asp:Button runat="server" ID="btnSaveAttach" Text='<%$ Resources:UserSite, resSaveFile %>'
							OnClick="btnSaveAttach_Click" Visible="False" />
					</div>
					<div class="editorBlockButton">
						<asp:CheckBox runat="server" ID="cbCloseAfterSave" Text='<%$ Resources:UserSite, resCloseAfterSave %>' />
					</div>
				</div>
				<div class="editorBlockButton">
					<asp:Button runat="server" ID="btnSave" Text='<%$ Resources:UserSite, resSave %>'
						OnClick="btnSave_Click" ValidationGroup="vgEditEvent" />
					<asp:Button runat="server" ID="btnList" Text='<%$ Resources:UserSite, resToList %>'
						OnClick="btnList_Click" />
					<asp:ValidationSummary runat="server" ID="vsEditEvent" DisplayMode="BulletList" ValidationGroup="vgEditEvent"
						ShowMessageBox="True" ShowSummary="False" />
				</div>
			</div>
		</asp:View>
	</asp:MultiView>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphBody" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphPanel" runat="server">
</asp:Content>
